<?php

	namespace Phptricks\app\models\pages;

/*
	 *  phptricks Framework 
	 *  link http://phptricks.net/Framework
	 *  date start 2014
	 */
	/**
	 * Description of newPHPClass
	 *
	 * @author Abd Elfttah Ahmed <phptricks.net@gmail.com>
	 */
	use Phptricks\system\library\models\models as models;
	use Phptricks\system\library\PhptricksExceptions\PhptricksExceptions as Exc;
	use Phptricks\system\core\library\library;

	class pages extends models implements library{

		private static $_instance = null;
		private $table_name = 'pages';

		public static function getinstance(){
			if (self::$_instance === null) {
				self::$_instance = new \Phptricks\app\models\pages\pages();
			}
			return self::$_instance;
		}

		public function _initialize(){
			
		}

		public function getpages($array_where = '', $order_by = 'page_order ASC'){
			$this->select('', $this->table_name);
			$this->where($array_where);
			$data = $this->execute('', $order_by, '',1000);
			return $data;
		}

		public function addpages($array_data = array()){
			return $this->insert($this->table_name, $array_data);
		}

		public function updatepages($array_data = array(), $where = array()){
			return $this->update($this->table_name, $array_data, $where);
		}

		public function deletepages($array_data){
			return $this->delete($this->table_name, $array_data);
		}

	}
	